<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Vue非构建模式开发框架</title>
		<link rel="icon" type="image/png" sizes="96*54" href="/theme/favicon96.png" />
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" href="theme/css/layui.css">
		<link rel="stylesheet" href="theme/css/layer/default/layer.css?v=3.3.0">
		<link rel="stylesheet" href="theme/css/login.css">
		<link rel="stylesheet" href="theme/css/common.css">
		<link rel="stylesheet" href="theme/css/modal.css">
		<!-- 导入element-plus样式 -->
		<link rel="stylesheet" href="//unpkg.com/element-plus/dist/index.css" />
		
		<script src="https://unpkg.com/vue@next"></script>
		<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
		<script src="js/Config.js"></script>
		<script src="js/req.process.js"></script>
		<script src="js/component.util.js"></script>
		<!-- 导入element-plus组件库 -->
		<script src="//unpkg.com/element-plus"></script>
		
	</head>
	
	<body class="layui-layout-body" style="background-color: #f2f2f2;">
		<div id="app">
			<component v-bind:is="main">
				<div style="text-align:center;padding:150px;">
					<el-button type="warning">ElementUI 按钮</el-button>
					<el-button type="primary" v-on:click="enterLogin">进入登录界面</el-button>
					<el-button type="success" v-on:click="enterMain">进入系统主页</el-button>
				</div>
			</component>
		</div>
	</body>
	
	<script>
	var IndexMv;
	var IndexApp = 
		Vue.createApp({
			data(){
				return {main:'emptyComponent'}
			},
			mounted(){
				//刷新时，自动挂载最后的子组件
				ComponentUtil.loadCurrentComponent(this);
			},
			methods:{
				enterLogin(){
					ComponentUtil.build({
						url : '/view/login',
						parentInst: this ,//父组件vue组件实例
						pushState:true
					});
				},
				enterMain(){
					//动态创建组件并挂载
					ComponentUtil.build({
						url : '/view/main',
						parentInst: this ,//父组件vue组件实例
						pushState:true
					});
				}
			}
		});
	IndexApp.use(ElementPlus);
	IndexMv = IndexApp.mount('#app');
	
	</script>
	
	
</html>
